﻿using System;
using System.Web;
using Import;
using Web.Helpers;

namespace Web.Handlers.Data
{
    [Serializable]
    public class ImportData
    {
        public ImportData()
        {
        }
        public ImportData(HttpContext context) : base()
        {
            if (context.Request.Files.Count == 0)
                return;

            var file = context.Request.Files[0];
            this.FileInfo = new ImportFileInfo(FileHelper.ReadBytesFromStream(file.InputStream), file.ContentType, file.FileName);
        }

        public string Id { get; set; }
        public ImportFileInfo FileInfo { get; set; }
        public int? IdScript { get; set; }
        public int? IdTranslator { get; set; }
        public string TranslatorFirstName { get; set; }
        public string TranslatorLastName { get; set; }
        public string UploadDirectory { get; set; }
        public string SavedFileName { get; set; }
    }
}